package com.junzhiit.nengji.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.bainaeco.framework.base.dao.AbstractBaseDAO;
import com.bainaeco.framework.common.jdbc.StatementParameter;
import com.bainaeco.framework.enums.IsDelete;
import com.junzhiit.nengji.dao.GoodsImagesDAO;
import com.junzhiit.nengji.model.GoodsImages;

@Repository
public class GoodsImagesDAOImpl extends AbstractBaseDAO<GoodsImages> implements GoodsImagesDAO {

	@Override
	public List<GoodsImages> findByGoodsId(String goodsId) {
		String sql = "select * from goods_images where is_delete=? and goods_id=? order by sort asc";

		StatementParameter param = new StatementParameter();
		param.setInt(IsDelete.NO.toIntValue());
		param.setString(goodsId);

		return queryForList(sql, GoodsImages.class, param);
	}
}
